package sve;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Stack;
import java.io.PrintStream;
import java.util.Set;

public class Utils {

	public static void print(Set s) {
		print(System.out, s);
	}

	public static void print(PrintStream out, Set s) {
		for (Object o : s) {
			out.println(o.toString());
		}
	}

	public static void print(List s) {
		print(System.out, s);
	}

	public static void print(PrintStream out, List s) {
		for (Object o : s) {
			out.println(o.toString());
		}
	}

	public static boolean contains(String v, String[] q) {
		for (String s : q) {
			if (s.equals(v)) {
				return true;
			}
		}
		return false;
	}

	public static boolean contains(String v, Set s) {
		return s.contains(v);
	}

	public static boolean contains(String v, ArrayList o) {
		return o.contains(v);
	}

	public static boolean isInStack(Set cv, Stack s) {
		for (Object item : cv) {
			if (!s.contains(item)) {
				return false;
			}
		}

		return true;
	}
}
